package com.example.mapper;

import com.example.entity.Salary;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface SalaryMapper {

    List<Salary> selectAll(Salary salary);

    List<Salary> selectYear(Salary salary);

    void insert(Salary salary);

    void updateById(Salary salary);

    @Delete("delete from `salary` where id = #{id}")
    void deleteById(Integer id);

    @Select("select round(AVG(price), 2) as price from salary where year = #{year} and department_id = #{departmentId}")
    Double selectAvgPrice(String year,Integer departmentId);
}